import { createApp } from 'vue'
import App from './App.vue'
import Router from './router/Router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import './assets/base.css'
import Request from '@/utils/Request'
import Api from '@/utils/Api'
import * as Pinia from 'pinia'
import '@/assets/icon/iconfont.css'
import Image from "@/components/Image.vue"
import LeftAndRight from "@/components/LeftAndRight.vue"
import UserBaseInfo from "@/components/UserBaseInfo.vue"
import ContentPanel from "@/components/ContentPanel.vue"
import Confirm from './utils/Confirm'
import Dialog from "@/components/Dialog.vue"
import * as WebSocket from '@/utils/WebSocket'
import Date from "@/utils/Date.js"
import Utils from "@/utils/Utils.js"
import UserIcon from "@/components/UserIcon.vue"
import UniqueId from "@/utils/UniqueId.js"
import Badge from "@/components/Badge.vue"


const app = createApp(App)
app.use(Router)
app.use(ElementPlus,{
    locale: zhCn,
  })
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }
app.config.globalProperties.Request = Request
app.config.globalProperties.Api = Api
app.use(Pinia.createPinia())
app.component("Image", Image);
app.component("LeftAndRight", LeftAndRight);
app.component("UserBaseInfo", UserBaseInfo);
app.component("ContentPanel", ContentPanel);
app.config.globalProperties.Confirm = Confirm;
app.component("Dialog", Dialog);
app.config.globalProperties.WebSocket = WebSocket;
app.config.globalProperties.Date = Date;
app.config.globalProperties.Utils = Utils
app.component("UserIcon", UserIcon);
app.config.globalProperties.UniqueId = UniqueId;
app.component("Badge", Badge);
app.mount('#app')
